﻿// Fill out your copyright notice in the Description page of Project Settings.


#include "AbilitySystem/Abilities/StarrySkyDamageGameplayAbility.h"

FDamageEffectParams UStarrySkyDamageGameplayAbility::MakeDamageEffectParamsFromClassDefaults(AActor* TargetActor,
	FVector InRadialDamageOrigin, bool bOverrideKnockbackDirection, FVector KnockbackDirectionOverride,
	bool bOverrideDeathImpulse, FVector DeathImpulseDirectionOverride, bool bOverridePitch, float PitchOverride) const
{
	FDamageEffectParams Params;
	//设置世界上下文,需要一个有效的对象，可以直接使用能力源代理角色
	Params.WorldContextObject=GetAvatarActorFromActorInfo();
	//设置伤害类
	Params.DamageGameplayEffectClass = DamageEffectClass;
	//设置伤害类型
	Params.DamageType = DamageType;
	//设置伤害
	//设置基础伤害值
	Params.BaseDamage=Damage.GetValueAtLevel(GetAbilityLevel());
	//设置等级
	Params.AbilityLevel=GetAbilityLevel();
	//设置伤害源能力系统组件
	Params.SourceAbilitySystemComponent=GetAbilitySystemComponentFromActorInfo();
	return Params;
}
